package gupao.edu.spring.demo.action;

import gupao.edu.spring.demo.service.ITestService;
import gupao_edu_spring_beans.beans.factory.annotation.MYAutowired;
import gupao_edu_spring_context.stereotype.MYController;
import gupao_edu_spring_webmvc.web.bind.annotation.MYRequestMapping;
import gupao_edu_spring_webmvc.web.bind.annotation.MYRequestParam;
import gupao_edu_spring_webmvc.web.servlet.MYModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName:
 * @Description:
 * @Auther: zhouych
 * @Date: 2019/5/9 21:01
 */
@MYController
@MYRequestMapping("/test")
public class TestAction extends BaseAction {

    @MYAutowired
    private ITestService testService;

    @MYRequestMapping("/test.json")
    public MYModelAndView test(HttpServletRequest request, HttpServletResponse response,
                               @MYRequestParam("data") String data){
        String result = testService.test(data);
        return super.out(response,result);
    }
}
